-
Notifications
You must be signed in to change notification settings - Fork 8
Use serial instead of SCSI ID for USB devices #107
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: 3.2.12-8.3
Are you sure you want to change the base?
Conversation
6727526 to
9946f5e
Compare
|
Hi! Thank you for your contribution. Could you please sign-off your commit after taking the suggestions into account? |
|
Also IMHO a commit like |
e464d66 to
9802153
Compare
drivers/util.py
Outdated
| except CommandException: | ||
| usb_device_with_serial = False |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| except CommandException: | |
| usb_device_with_serial = False | |
| except Exception as e: | |
| usb_device_with_serial = False | |
| SMlog(f"Unable to check if device is USB: {e}") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not a big fan of broad exception catch but ok. Regarding the log, just using f-string interpolation on exception is often not very helpful. Would it be ok for you to do the log like this:
| except CommandException: | |
| usb_device_with_serial = False | |
| except: | |
| usb_device_with_serial = False | |
| SMlog("Unable to check if device is USB:") | |
| SMlog(traceback.format_exc()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can commit your suggestion, not a blocking point I guess.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok it is committed.
Signed-off-by: Frederic Bor <[email protected]>
9802153 to
ce6361c
Compare
adding SRs on multiple usb devices may fail because /usr/lib/udev/scsi_id returns the same device id for all the usb devices.
This PR fixes this by checking the drive type and using the device serial number if correctly read.